package com.ruoyi.comn.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comn.mapper.ComnDeptTeamsMapper;
import com.ruoyi.comn.domain.ComnDeptTeams;
import com.ruoyi.comn.service.IComnDeptTeamsService;

import javax.annotation.Resource;

/**
 * 班组管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-25
 */
@Service
public class ComnDeptTeamsServiceImpl implements IComnDeptTeamsService 
{
    @Resource
    private ComnDeptTeamsMapper comnDeptTeamsMapper;

    /**
     * 查询班组管理
     * 
     * @param deptTeamUuid 班组管理主键
     * @return 班组管理
     */
    @Override
    public ComnDeptTeams selectComnDeptTeamsByDeptTeamUuid(String deptTeamUuid)
    {
        return comnDeptTeamsMapper.selectComnDeptTeamsByDeptTeamUuid(deptTeamUuid);
    }

    /**
     * 查询班组管理列表
     * 
     * @param comnDeptTeams 班组管理
     * @return 班组管理
     */
    @Override
    public List<ComnDeptTeams> selectComnDeptTeamsList(ComnDeptTeams comnDeptTeams)
    {
        return comnDeptTeamsMapper.selectComnDeptTeamsList(comnDeptTeams);
    }

    /**
     * 新增班组管理
     * 
     * @param comnDeptTeams 班组管理
     * @return 结果
     */
    @Override
    public int insertComnDeptTeams(ComnDeptTeams comnDeptTeams)
    {
        comnDeptTeams.setCreateBy(SecurityUtils.getUsername());
        comnDeptTeams.setCreateTime(DateUtils.getNowDate());
        return comnDeptTeamsMapper.insertComnDeptTeams(comnDeptTeams);
    }

    /**
     * 修改班组管理
     * 
     * @param comnDeptTeams 班组管理
     * @return 结果
     */
    @Override
    public int updateComnDeptTeams(ComnDeptTeams comnDeptTeams)
    {
        comnDeptTeams.setUpdateBy(SecurityUtils.getUsername());
        comnDeptTeams.setUpdateTime(DateUtils.getNowDate());
        return comnDeptTeamsMapper.updateComnDeptTeams(comnDeptTeams);
    }

    /**
     * 批量删除班组管理
     * 
     * @param deptTeamUuids 需要删除的班组管理主键
     * @return 结果
     */
    @Override
    public int deleteComnDeptTeamsByDeptTeamUuids(String[] deptTeamUuids)
    {
        return comnDeptTeamsMapper.deleteComnDeptTeamsByDeptTeamUuids(deptTeamUuids);
    }

    /**
     * 删除班组管理信息
     * 
     * @param deptTeamUuid 班组管理主键
     * @return 结果
     */
    @Override
    public int deleteComnDeptTeamsByDeptTeamUuid(String deptTeamUuid)
    {
        return comnDeptTeamsMapper.deleteComnDeptTeamsByDeptTeamUuid(deptTeamUuid);
    }
}
